package com.ktgj.customer.service.impl;

import com.ktgj.customer.service.IHomeBannerService;
import com.ktgj.customer.domain.HomeBanner;
import com.ktgj.customer.mapper.HomeBannerMapper;
import com.ktgj.customer.vo.HomeBannerVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 首页动态标题Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class HomeBannerServiceImpl implements IHomeBannerService
{
    @Autowired
    private HomeBannerMapper homeBannerMapper;

    /**
     * 查询首页动态标题
     *
     * @param bannerId 首页动态标题ID
     * @return 首页动态标题
     */
    @Override
    public HomeBanner selectHomeBannerByBannerId(Long bannerId)
    {
        return homeBannerMapper.selectHomeBannerByBannerId(bannerId);
    }

    /**
     * 查询首页动态标题列表
     *
     * @param homeBanner 首页动态标题
     * @return 首页动态标题
     */
    @Override
    public List<HomeBanner> selectHomeBannerList(HomeBanner homeBanner)
    {
        return homeBannerMapper.selectHomeBannerList(homeBanner);
    }

    /**
     * 新增首页动态标题
     *
     * @param homeBanner 首页动态标题
     * @return 结果
     */
    @Override
    public int insertHomeBanner(HomeBanner homeBanner)
    {
        return homeBannerMapper.insertHomeBanner(homeBanner);
    }

    /**
     * 修改首页动态标题
     *
     * @param homeBanner 首页动态标题
     * @return 结果
     */
    @Override
    public int updateHomeBanner(HomeBanner homeBanner)
    {
        return homeBannerMapper.updateHomeBanner(homeBanner);
    }

    /**
     * 批量删除首页动态标题
     *
     * @param bannerIds 需要删除的首页动态标题ID
     * @return 结果
     */
    @Override
    public int deleteHomeBannerByBannerIds(Long[] bannerIds)
    {
        return homeBannerMapper.deleteHomeBannerByBannerIds(bannerIds);
    }

    /**
     * 获取banner
     * @param bannerType 类型
     * @return 首页动态标题集合
     * */
    @Override
    public List<HomeBannerVO> selectHomeBannerByBannerType(String bannerType) {
        return homeBannerMapper.selectHomeBannerByBannerType(bannerType);
    }

}
